package cn.z2huo.productcenter.enums.flag;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * <p>
 *
 * @author z2huo
 */
@Getter
@RequiredArgsConstructor
public enum SyncFlagEnum {

    SYNC("1", "已同步"),

    NOT_SYNC("0", "未同步"),

    ;

    private final String value;

    private final String desc;

    private static final Map<String, SyncFlagEnum> valueMap
            = Arrays.stream(SyncFlagEnum.values()).collect(Collectors.toMap(SyncFlagEnum::getValue, flag -> flag));

    public static SyncFlagEnum fromValue(String value) {
        return valueMap.get(value);
    }
    
}
